Left Termination of the query pattern qsort_in_2(g, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

qsort([], []).
qsort(.(H, L), S) :- ','(split(L, H, A, B), ','(qsort(A, A1), ','(qsort(B, B1), append(A1, .(H, B1), S)))).
split([], Y, [], []).
split(.(X, Xs), Y, .(X, Ls), Bs) :- ','(le(X, Y), split(Xs, Y, Ls, Bs)).
split(.(X, Xs), Y, Ls, .(X, Bs)) :- ','(gt(X, Y), split(Xs, Y, Ls, Bs)).
append([], L, L).
append(.(H, L1), L2, .(H, L3)) :- append(L1, L2, L3).
gt(s(X), s(Y)) :- gt(X, Y).
gt(s(X), 0).
le(s(X), s(Y)) :- le(X, Y).
le(0, s(Y)).
le(0, 0).

Queries:

qsort(g,a).

We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
qsort_in: (b,f)
split_in: (b,b,f,f)
le_in: (b,b)
gt_in: (b,b)
append_in: (b,b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

qsort_in_ga([], []) → qsort_out_ga([], [])
qsort_in_ga(.(H, L), S) → U1_ga(H, L, S, split_in_ggaa(L, H, A, B))
split_in_ggaa([], Y, [], []) → split_out_ggaa([], Y, [], [])
split_in_ggaa(.(X, Xs), Y, .(X, Ls), Bs) → U5_ggaa(X, Xs, Y, Ls, Bs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_ggaa(X, Xs, Y, Ls, Bs, le_out_gg(X, Y)) → U6_ggaa(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
split_in_ggaa(.(X, Xs), Y, Ls, .(X, Bs)) → U7_ggaa(X, Xs, Y, Ls, Bs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_ggaa(X, Xs, Y, Ls, Bs, gt_out_gg(X, Y)) → U8_ggaa(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
U8_ggaa(X, Xs, Y, Ls, Bs, split_out_ggaa(Xs, Y, Ls, Bs)) → split_out_ggaa(.(X, Xs), Y, Ls, .(X, Bs))
U6_ggaa(X, Xs, Y, Ls, Bs, split_out_ggaa(Xs, Y, Ls, Bs)) → split_out_ggaa(.(X, Xs), Y, .(X, Ls), Bs)
U1_ga(H, L, S, split_out_ggaa(L, H, A, B)) → U2_ga(H, L, S, B, qsort_in_ga(A, A1))
U2_ga(H, L, S, B, qsort_out_ga(A, A1)) → U3_ga(H, L, S, A1, qsort_in_ga(B, B1))
U3_ga(H, L, S, A1, qsort_out_ga(B, B1)) → U4_ga(H, L, S, append_in_gga(A1, .(H, B1), S))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U9_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U9_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U4_ga(H, L, S, append_out_gga(A1, .(H, B1), S)) → qsort_out_ga(.(H, L), S)

The argument filtering Pi contains the following mapping:
qsort_in_ga(x1, x2)  =  qsort_in_ga(x1)
[]  =  []
qsort_out_ga(x1, x2)  =  qsort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x1, x4)
split_in_ggaa(x1, x2, x3, x4)  =  split_in_ggaa(x1, x2)
split_out_ggaa(x1, x2, x3, x4)  =  split_out_ggaa(x3, x4)
U5_ggaa(x1, x2, x3, x4, x5, x6)  =  U5_ggaa(x1, x2, x3, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U6_ggaa(x1, x2, x3, x4, x5, x6)  =  U6_ggaa(x1, x6)
U7_ggaa(x1, x2, x3, x4, x5, x6)  =  U7_ggaa(x1, x2, x3, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U8_ggaa(x1, x2, x3, x4, x5, x6)  =  U8_ggaa(x1, x6)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x1, x4, x5)
U3_ga(x1, x2, x3, x4, x5)  =  U3_ga(x1, x4, x5)
U4_ga(x1, x2, x3, x4)  =  U4_ga(x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
U9_gga(x1, x2, x3, x4, x5)  =  U9_gga(x1, x5)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

qsort_in_ga([], []) → qsort_out_ga([], [])
qsort_in_ga(.(H, L), S) → U1_ga(H, L, S, split_in_ggaa(L, H, A, B))
split_in_ggaa([], Y, [], []) → split_out_ggaa([], Y, [], [])
split_in_ggaa(.(X, Xs), Y, .(X, Ls), Bs) → U5_ggaa(X, Xs, Y, Ls, Bs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_ggaa(X, Xs, Y, Ls, Bs, le_out_gg(X, Y)) → U6_ggaa(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
split_in_ggaa(.(X, Xs), Y, Ls, .(X, Bs)) → U7_ggaa(X, Xs, Y, Ls, Bs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_ggaa(X, Xs, Y, Ls, Bs, gt_out_gg(X, Y)) → U8_ggaa(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
U8_ggaa(X, Xs, Y, Ls, Bs, split_out_ggaa(Xs, Y, Ls, Bs)) → split_out_ggaa(.(X, Xs), Y, Ls, .(X, Bs))
U6_ggaa(X, Xs, Y, Ls, Bs, split_out_ggaa(Xs, Y, Ls, Bs)) → split_out_ggaa(.(X, Xs), Y, .(X, Ls), Bs)
U1_ga(H, L, S, split_out_ggaa(L, H, A, B)) → U2_ga(H, L, S, B, qsort_in_ga(A, A1))
U2_ga(H, L, S, B, qsort_out_ga(A, A1)) → U3_ga(H, L, S, A1, qsort_in_ga(B, B1))
U3_ga(H, L, S, A1, qsort_out_ga(B, B1)) → U4_ga(H, L, S, append_in_gga(A1, .(H, B1), S))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U9_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U9_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U4_ga(H, L, S, append_out_gga(A1, .(H, B1), S)) → qsort_out_ga(.(H, L), S)

The argument filtering Pi contains the following mapping:
qsort_in_ga(x1, x2)  =  qsort_in_ga(x1)
[]  =  []
qsort_out_ga(x1, x2)  =  qsort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x1, x4)
split_in_ggaa(x1, x2, x3, x4)  =  split_in_ggaa(x1, x2)
split_out_ggaa(x1, x2, x3, x4)  =  split_out_ggaa(x3, x4)
U5_ggaa(x1, x2, x3, x4, x5, x6)  =  U5_ggaa(x1, x2, x3, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U6_ggaa(x1, x2, x3, x4, x5, x6)  =  U6_ggaa(x1, x6)
U7_ggaa(x1, x2, x3, x4, x5, x6)  =  U7_ggaa(x1, x2, x3, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U8_ggaa(x1, x2, x3, x4, x5, x6)  =  U8_ggaa(x1, x6)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x1, x4, x5)
U3_ga(x1, x2, x3, x4, x5)  =  U3_ga(x1, x4, x5)
U4_ga(x1, x2, x3, x4)  =  U4_ga(x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
U9_gga(x1, x2, x3, x4, x5)  =  U9_gga(x1, x5)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

QSORT_IN_GA(.(H, L), S) → U1_GA(H, L, S, split_in_ggaa(L, H, A, B))
QSORT_IN_GA(.(H, L), S) → SPLIT_IN_GGAA(L, H, A, B)
SPLIT_IN_GGAA(.(X, Xs), Y, .(X, Ls), Bs) → U5_GGAA(X, Xs, Y, Ls, Bs, le_in_gg(X, Y))
SPLIT_IN_GGAA(.(X, Xs), Y, .(X, Ls), Bs) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → U11_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U5_GGAA(X, Xs, Y, Ls, Bs, le_out_gg(X, Y)) → U6_GGAA(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
U5_GGAA(X, Xs, Y, Ls, Bs, le_out_gg(X, Y)) → SPLIT_IN_GGAA(Xs, Y, Ls, Bs)
SPLIT_IN_GGAA(.(X, Xs), Y, Ls, .(X, Bs)) → U7_GGAA(X, Xs, Y, Ls, Bs, gt_in_gg(X, Y))
SPLIT_IN_GGAA(.(X, Xs), Y, Ls, .(X, Bs)) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → U10_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U7_GGAA(X, Xs, Y, Ls, Bs, gt_out_gg(X, Y)) → U8_GGAA(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
U7_GGAA(X, Xs, Y, Ls, Bs, gt_out_gg(X, Y)) → SPLIT_IN_GGAA(Xs, Y, Ls, Bs)
U1_GA(H, L, S, split_out_ggaa(L, H, A, B)) → U2_GA(H, L, S, B, qsort_in_ga(A, A1))
U1_GA(H, L, S, split_out_ggaa(L, H, A, B)) → QSORT_IN_GA(A, A1)
U2_GA(H, L, S, B, qsort_out_ga(A, A1)) → U3_GA(H, L, S, A1, qsort_in_ga(B, B1))
U2_GA(H, L, S, B, qsort_out_ga(A, A1)) → QSORT_IN_GA(B, B1)
U3_GA(H, L, S, A1, qsort_out_ga(B, B1)) → U4_GA(H, L, S, append_in_gga(A1, .(H, B1), S))
U3_GA(H, L, S, A1, qsort_out_ga(B, B1)) → APPEND_IN_GGA(A1, .(H, B1), S)
APPEND_IN_GGA(.(H, L1), L2, .(H, L3)) → U9_GGA(H, L1, L2, L3, append_in_gga(L1, L2, L3))
APPEND_IN_GGA(.(H, L1), L2, .(H, L3)) → APPEND_IN_GGA(L1, L2, L3)

The TRS R consists of the following rules:

qsort_in_ga([], []) → qsort_out_ga([], [])
qsort_in_ga(.(H, L), S) → U1_ga(H, L, S, split_in_ggaa(L, H, A, B))
split_in_ggaa([], Y, [], []) → split_out_ggaa([], Y, [], [])
split_in_ggaa(.(X, Xs), Y, .(X, Ls), Bs) → U5_ggaa(X, Xs, Y, Ls, Bs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_ggaa(X, Xs, Y, Ls, Bs, le_out_gg(X, Y)) → U6_ggaa(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
split_in_ggaa(.(X, Xs), Y, Ls, .(X, Bs)) → U7_ggaa(X, Xs, Y, Ls, Bs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_ggaa(X, Xs, Y, Ls, Bs, gt_out_gg(X, Y)) → U8_ggaa(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
U8_ggaa(X, Xs, Y, Ls, Bs, split_out_ggaa(Xs, Y, Ls, Bs)) → split_out_ggaa(.(X, Xs), Y, Ls, .(X, Bs))
U6_ggaa(X, Xs, Y, Ls, Bs, split_out_ggaa(Xs, Y, Ls, Bs)) → split_out_ggaa(.(X, Xs), Y, .(X, Ls), Bs)
U1_ga(H, L, S, split_out_ggaa(L, H, A, B)) → U2_ga(H, L, S, B, qsort_in_ga(A, A1))
U2_ga(H, L, S, B, qsort_out_ga(A, A1)) → U3_ga(H, L, S, A1, qsort_in_ga(B, B1))
U3_ga(H, L, S, A1, qsort_out_ga(B, B1)) → U4_ga(H, L, S, append_in_gga(A1, .(H, B1), S))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U9_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U9_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U4_ga(H, L, S, append_out_gga(A1, .(H, B1), S)) → qsort_out_ga(.(H, L), S)

The argument filtering Pi contains the following mapping:
qsort_in_ga(x1, x2)  =  qsort_in_ga(x1)
[]  =  []
qsort_out_ga(x1, x2)  =  qsort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x1, x4)
split_in_ggaa(x1, x2, x3, x4)  =  split_in_ggaa(x1, x2)
split_out_ggaa(x1, x2, x3, x4)  =  split_out_ggaa(x3, x4)
U5_ggaa(x1, x2, x3, x4, x5, x6)  =  U5_ggaa(x1, x2, x3, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U6_ggaa(x1, x2, x3, x4, x5, x6)  =  U6_ggaa(x1, x6)
U7_ggaa(x1, x2, x3, x4, x5, x6)  =  U7_ggaa(x1, x2, x3, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U8_ggaa(x1, x2, x3, x4, x5, x6)  =  U8_ggaa(x1, x6)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x1, x4, x5)
U3_ga(x1, x2, x3, x4, x5)  =  U3_ga(x1, x4, x5)
U4_ga(x1, x2, x3, x4)  =  U4_ga(x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
U9_gga(x1, x2, x3, x4, x5)  =  U9_gga(x1, x5)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
U6_GGAA(x1, x2, x3, x4, x5, x6)  =  U6_GGAA(x1, x6)
U5_GGAA(x1, x2, x3, x4, x5, x6)  =  U5_GGAA(x1, x2, x3, x6)
U9_GGA(x1, x2, x3, x4, x5)  =  U9_GGA(x1, x5)
QSORT_IN_GA(x1, x2)  =  QSORT_IN_GA(x1)
U8_GGAA(x1, x2, x3, x4, x5, x6)  =  U8_GGAA(x1, x6)
U7_GGAA(x1, x2, x3, x4, x5, x6)  =  U7_GGAA(x1, x2, x3, x6)
U1_GA(x1, x2, x3, x4)  =  U1_GA(x1, x4)
U2_GA(x1, x2, x3, x4, x5)  =  U2_GA(x1, x4, x5)
U4_GA(x1, x2, x3, x4)  =  U4_GA(x4)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)
U11_GG(x1, x2, x3)  =  U11_GG(x3)
U10_GG(x1, x2, x3)  =  U10_GG(x3)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
U3_GA(x1, x2, x3, x4, x5)  =  U3_GA(x1, x4, x5)
SPLIT_IN_GGAA(x1, x2, x3, x4)  =  SPLIT_IN_GGAA(x1, x2)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

QSORT_IN_GA(.(H, L), S) → U1_GA(H, L, S, split_in_ggaa(L, H, A, B))
QSORT_IN_GA(.(H, L), S) → SPLIT_IN_GGAA(L, H, A, B)
SPLIT_IN_GGAA(.(X, Xs), Y, .(X, Ls), Bs) → U5_GGAA(X, Xs, Y, Ls, Bs, le_in_gg(X, Y))
SPLIT_IN_GGAA(.(X, Xs), Y, .(X, Ls), Bs) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → U11_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U5_GGAA(X, Xs, Y, Ls, Bs, le_out_gg(X, Y)) → U6_GGAA(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
U5_GGAA(X, Xs, Y, Ls, Bs, le_out_gg(X, Y)) → SPLIT_IN_GGAA(Xs, Y, Ls, Bs)
SPLIT_IN_GGAA(.(X, Xs), Y, Ls, .(X, Bs)) → U7_GGAA(X, Xs, Y, Ls, Bs, gt_in_gg(X, Y))
SPLIT_IN_GGAA(.(X, Xs), Y, Ls, .(X, Bs)) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → U10_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U7_GGAA(X, Xs, Y, Ls, Bs, gt_out_gg(X, Y)) → U8_GGAA(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
U7_GGAA(X, Xs, Y, Ls, Bs, gt_out_gg(X, Y)) → SPLIT_IN_GGAA(Xs, Y, Ls, Bs)
U1_GA(H, L, S, split_out_ggaa(L, H, A, B)) → U2_GA(H, L, S, B, qsort_in_ga(A, A1))
U1_GA(H, L, S, split_out_ggaa(L, H, A, B)) → QSORT_IN_GA(A, A1)
U2_GA(H, L, S, B, qsort_out_ga(A, A1)) → U3_GA(H, L, S, A1, qsort_in_ga(B, B1))
U2_GA(H, L, S, B, qsort_out_ga(A, A1)) → QSORT_IN_GA(B, B1)
U3_GA(H, L, S, A1, qsort_out_ga(B, B1)) → U4_GA(H, L, S, append_in_gga(A1, .(H, B1), S))
U3_GA(H, L, S, A1, qsort_out_ga(B, B1)) → APPEND_IN_GGA(A1, .(H, B1), S)
APPEND_IN_GGA(.(H, L1), L2, .(H, L3)) → U9_GGA(H, L1, L2, L3, append_in_gga(L1, L2, L3))
APPEND_IN_GGA(.(H, L1), L2, .(H, L3)) → APPEND_IN_GGA(L1, L2, L3)

The TRS R consists of the following rules:

qsort_in_ga([], []) → qsort_out_ga([], [])
qsort_in_ga(.(H, L), S) → U1_ga(H, L, S, split_in_ggaa(L, H, A, B))
split_in_ggaa([], Y, [], []) → split_out_ggaa([], Y, [], [])
split_in_ggaa(.(X, Xs), Y, .(X, Ls), Bs) → U5_ggaa(X, Xs, Y, Ls, Bs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_ggaa(X, Xs, Y, Ls, Bs, le_out_gg(X, Y)) → U6_ggaa(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
split_in_ggaa(.(X, Xs), Y, Ls, .(X, Bs)) → U7_ggaa(X, Xs, Y, Ls, Bs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_ggaa(X, Xs, Y, Ls, Bs, gt_out_gg(X, Y)) → U8_ggaa(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
U8_ggaa(X, Xs, Y, Ls, Bs, split_out_ggaa(Xs, Y, Ls, Bs)) → split_out_ggaa(.(X, Xs), Y, Ls, .(X, Bs))
U6_ggaa(X, Xs, Y, Ls, Bs, split_out_ggaa(Xs, Y, Ls, Bs)) → split_out_ggaa(.(X, Xs), Y, .(X, Ls), Bs)
U1_ga(H, L, S, split_out_ggaa(L, H, A, B)) → U2_ga(H, L, S, B, qsort_in_ga(A, A1))
U2_ga(H, L, S, B, qsort_out_ga(A, A1)) → U3_ga(H, L, S, A1, qsort_in_ga(B, B1))
U3_ga(H, L, S, A1, qsort_out_ga(B, B1)) → U4_ga(H, L, S, append_in_gga(A1, .(H, B1), S))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U9_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U9_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U4_ga(H, L, S, append_out_gga(A1, .(H, B1), S)) → qsort_out_ga(.(H, L), S)

The argument filtering Pi contains the following mapping:
qsort_in_ga(x1, x2)  =  qsort_in_ga(x1)
[]  =  []
qsort_out_ga(x1, x2)  =  qsort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x1, x4)
split_in_ggaa(x1, x2, x3, x4)  =  split_in_ggaa(x1, x2)
split_out_ggaa(x1, x2, x3, x4)  =  split_out_ggaa(x3, x4)
U5_ggaa(x1, x2, x3, x4, x5, x6)  =  U5_ggaa(x1, x2, x3, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U6_ggaa(x1, x2, x3, x4, x5, x6)  =  U6_ggaa(x1, x6)
U7_ggaa(x1, x2, x3, x4, x5, x6)  =  U7_ggaa(x1, x2, x3, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U8_ggaa(x1, x2, x3, x4, x5, x6)  =  U8_ggaa(x1, x6)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x1, x4, x5)
U3_ga(x1, x2, x3, x4, x5)  =  U3_ga(x1, x4, x5)
U4_ga(x1, x2, x3, x4)  =  U4_ga(x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
U9_gga(x1, x2, x3, x4, x5)  =  U9_gga(x1, x5)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
U6_GGAA(x1, x2, x3, x4, x5, x6)  =  U6_GGAA(x1, x6)
U5_GGAA(x1, x2, x3, x4, x5, x6)  =  U5_GGAA(x1, x2, x3, x6)
U9_GGA(x1, x2, x3, x4, x5)  =  U9_GGA(x1, x5)
QSORT_IN_GA(x1, x2)  =  QSORT_IN_GA(x1)
U8_GGAA(x1, x2, x3, x4, x5, x6)  =  U8_GGAA(x1, x6)
U7_GGAA(x1, x2, x3, x4, x5, x6)  =  U7_GGAA(x1, x2, x3, x6)
U1_GA(x1, x2, x3, x4)  =  U1_GA(x1, x4)
U2_GA(x1, x2, x3, x4, x5)  =  U2_GA(x1, x4, x5)
U4_GA(x1, x2, x3, x4)  =  U4_GA(x4)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)
U11_GG(x1, x2, x3)  =  U11_GG(x3)
U10_GG(x1, x2, x3)  =  U10_GG(x3)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
U3_GA(x1, x2, x3, x4, x5)  =  U3_GA(x1, x4, x5)
SPLIT_IN_GGAA(x1, x2, x3, x4)  =  SPLIT_IN_GGAA(x1, x2)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 5 SCCs with 11 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APPEND_IN_GGA(.(H, L1), L2, .(H, L3)) → APPEND_IN_GGA(L1, L2, L3)

The TRS R consists of the following rules:

qsort_in_ga([], []) → qsort_out_ga([], [])
qsort_in_ga(.(H, L), S) → U1_ga(H, L, S, split_in_ggaa(L, H, A, B))
split_in_ggaa([], Y, [], []) → split_out_ggaa([], Y, [], [])
split_in_ggaa(.(X, Xs), Y, .(X, Ls), Bs) → U5_ggaa(X, Xs, Y, Ls, Bs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_ggaa(X, Xs, Y, Ls, Bs, le_out_gg(X, Y)) → U6_ggaa(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
split_in_ggaa(.(X, Xs), Y, Ls, .(X, Bs)) → U7_ggaa(X, Xs, Y, Ls, Bs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_ggaa(X, Xs, Y, Ls, Bs, gt_out_gg(X, Y)) → U8_ggaa(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
U8_ggaa(X, Xs, Y, Ls, Bs, split_out_ggaa(Xs, Y, Ls, Bs)) → split_out_ggaa(.(X, Xs), Y, Ls, .(X, Bs))
U6_ggaa(X, Xs, Y, Ls, Bs, split_out_ggaa(Xs, Y, Ls, Bs)) → split_out_ggaa(.(X, Xs), Y, .(X, Ls), Bs)
U1_ga(H, L, S, split_out_ggaa(L, H, A, B)) → U2_ga(H, L, S, B, qsort_in_ga(A, A1))
U2_ga(H, L, S, B, qsort_out_ga(A, A1)) → U3_ga(H, L, S, A1, qsort_in_ga(B, B1))
U3_ga(H, L, S, A1, qsort_out_ga(B, B1)) → U4_ga(H, L, S, append_in_gga(A1, .(H, B1), S))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U9_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U9_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U4_ga(H, L, S, append_out_gga(A1, .(H, B1), S)) → qsort_out_ga(.(H, L), S)

The argument filtering Pi contains the following mapping:
qsort_in_ga(x1, x2)  =  qsort_in_ga(x1)
[]  =  []
qsort_out_ga(x1, x2)  =  qsort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x1, x4)
split_in_ggaa(x1, x2, x3, x4)  =  split_in_ggaa(x1, x2)
split_out_ggaa(x1, x2, x3, x4)  =  split_out_ggaa(x3, x4)
U5_ggaa(x1, x2, x3, x4, x5, x6)  =  U5_ggaa(x1, x2, x3, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U6_ggaa(x1, x2, x3, x4, x5, x6)  =  U6_ggaa(x1, x6)
U7_ggaa(x1, x2, x3, x4, x5, x6)  =  U7_ggaa(x1, x2, x3, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U8_ggaa(x1, x2, x3, x4, x5, x6)  =  U8_ggaa(x1, x6)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x1, x4, x5)
U3_ga(x1, x2, x3, x4, x5)  =  U3_ga(x1, x4, x5)
U4_ga(x1, x2, x3, x4)  =  U4_ga(x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
U9_gga(x1, x2, x3, x4, x5)  =  U9_gga(x1, x5)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APPEND_IN_GGA(.(H, L1), L2, .(H, L3)) → APPEND_IN_GGA(L1, L2, L3)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

APPEND_IN_GGA(.(H, L1), L2) → APPEND_IN_GGA(L1, L2)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

The TRS R consists of the following rules:

qsort_in_ga([], []) → qsort_out_ga([], [])
qsort_in_ga(.(H, L), S) → U1_ga(H, L, S, split_in_ggaa(L, H, A, B))
split_in_ggaa([], Y, [], []) → split_out_ggaa([], Y, [], [])
split_in_ggaa(.(X, Xs), Y, .(X, Ls), Bs) → U5_ggaa(X, Xs, Y, Ls, Bs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_ggaa(X, Xs, Y, Ls, Bs, le_out_gg(X, Y)) → U6_ggaa(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
split_in_ggaa(.(X, Xs), Y, Ls, .(X, Bs)) → U7_ggaa(X, Xs, Y, Ls, Bs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_ggaa(X, Xs, Y, Ls, Bs, gt_out_gg(X, Y)) → U8_ggaa(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
U8_ggaa(X, Xs, Y, Ls, Bs, split_out_ggaa(Xs, Y, Ls, Bs)) → split_out_ggaa(.(X, Xs), Y, Ls, .(X, Bs))
U6_ggaa(X, Xs, Y, Ls, Bs, split_out_ggaa(Xs, Y, Ls, Bs)) → split_out_ggaa(.(X, Xs), Y, .(X, Ls), Bs)
U1_ga(H, L, S, split_out_ggaa(L, H, A, B)) → U2_ga(H, L, S, B, qsort_in_ga(A, A1))
U2_ga(H, L, S, B, qsort_out_ga(A, A1)) → U3_ga(H, L, S, A1, qsort_in_ga(B, B1))
U3_ga(H, L, S, A1, qsort_out_ga(B, B1)) → U4_ga(H, L, S, append_in_gga(A1, .(H, B1), S))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U9_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U9_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U4_ga(H, L, S, append_out_gga(A1, .(H, B1), S)) → qsort_out_ga(.(H, L), S)

The argument filtering Pi contains the following mapping:
qsort_in_ga(x1, x2)  =  qsort_in_ga(x1)
[]  =  []
qsort_out_ga(x1, x2)  =  qsort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x1, x4)
split_in_ggaa(x1, x2, x3, x4)  =  split_in_ggaa(x1, x2)
split_out_ggaa(x1, x2, x3, x4)  =  split_out_ggaa(x3, x4)
U5_ggaa(x1, x2, x3, x4, x5, x6)  =  U5_ggaa(x1, x2, x3, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U6_ggaa(x1, x2, x3, x4, x5, x6)  =  U6_ggaa(x1, x6)
U7_ggaa(x1, x2, x3, x4, x5, x6)  =  U7_ggaa(x1, x2, x3, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U8_ggaa(x1, x2, x3, x4, x5, x6)  =  U8_ggaa(x1, x6)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x1, x4, x5)
U3_ga(x1, x2, x3, x4, x5)  =  U3_ga(x1, x4, x5)
U4_ga(x1, x2, x3, x4)  =  U4_ga(x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
U9_gga(x1, x2, x3, x4, x5)  =  U9_gga(x1, x5)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

The TRS R consists of the following rules:

qsort_in_ga([], []) → qsort_out_ga([], [])
qsort_in_ga(.(H, L), S) → U1_ga(H, L, S, split_in_ggaa(L, H, A, B))
split_in_ggaa([], Y, [], []) → split_out_ggaa([], Y, [], [])
split_in_ggaa(.(X, Xs), Y, .(X, Ls), Bs) → U5_ggaa(X, Xs, Y, Ls, Bs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_ggaa(X, Xs, Y, Ls, Bs, le_out_gg(X, Y)) → U6_ggaa(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
split_in_ggaa(.(X, Xs), Y, Ls, .(X, Bs)) → U7_ggaa(X, Xs, Y, Ls, Bs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_ggaa(X, Xs, Y, Ls, Bs, gt_out_gg(X, Y)) → U8_ggaa(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
U8_ggaa(X, Xs, Y, Ls, Bs, split_out_ggaa(Xs, Y, Ls, Bs)) → split_out_ggaa(.(X, Xs), Y, Ls, .(X, Bs))
U6_ggaa(X, Xs, Y, Ls, Bs, split_out_ggaa(Xs, Y, Ls, Bs)) → split_out_ggaa(.(X, Xs), Y, .(X, Ls), Bs)
U1_ga(H, L, S, split_out_ggaa(L, H, A, B)) → U2_ga(H, L, S, B, qsort_in_ga(A, A1))
U2_ga(H, L, S, B, qsort_out_ga(A, A1)) → U3_ga(H, L, S, A1, qsort_in_ga(B, B1))
U3_ga(H, L, S, A1, qsort_out_ga(B, B1)) → U4_ga(H, L, S, append_in_gga(A1, .(H, B1), S))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U9_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U9_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U4_ga(H, L, S, append_out_gga(A1, .(H, B1), S)) → qsort_out_ga(.(H, L), S)

The argument filtering Pi contains the following mapping:
qsort_in_ga(x1, x2)  =  qsort_in_ga(x1)
[]  =  []
qsort_out_ga(x1, x2)  =  qsort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x1, x4)
split_in_ggaa(x1, x2, x3, x4)  =  split_in_ggaa(x1, x2)
split_out_ggaa(x1, x2, x3, x4)  =  split_out_ggaa(x3, x4)
U5_ggaa(x1, x2, x3, x4, x5, x6)  =  U5_ggaa(x1, x2, x3, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U6_ggaa(x1, x2, x3, x4, x5, x6)  =  U6_ggaa(x1, x6)
U7_ggaa(x1, x2, x3, x4, x5, x6)  =  U7_ggaa(x1, x2, x3, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U8_ggaa(x1, x2, x3, x4, x5, x6)  =  U8_ggaa(x1, x6)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x1, x4, x5)
U3_ga(x1, x2, x3, x4, x5)  =  U3_ga(x1, x4, x5)
U4_ga(x1, x2, x3, x4)  =  U4_ga(x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
U9_gga(x1, x2, x3, x4, x5)  =  U9_gga(x1, x5)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

U7_GGAA(X, Xs, Y, Ls, Bs, gt_out_gg(X, Y)) → SPLIT_IN_GGAA(Xs, Y, Ls, Bs)
SPLIT_IN_GGAA(.(X, Xs), Y, .(X, Ls), Bs) → U5_GGAA(X, Xs, Y, Ls, Bs, le_in_gg(X, Y))
SPLIT_IN_GGAA(.(X, Xs), Y, Ls, .(X, Bs)) → U7_GGAA(X, Xs, Y, Ls, Bs, gt_in_gg(X, Y))
U5_GGAA(X, Xs, Y, Ls, Bs, le_out_gg(X, Y)) → SPLIT_IN_GGAA(Xs, Y, Ls, Bs)

The TRS R consists of the following rules:

qsort_in_ga([], []) → qsort_out_ga([], [])
qsort_in_ga(.(H, L), S) → U1_ga(H, L, S, split_in_ggaa(L, H, A, B))
split_in_ggaa([], Y, [], []) → split_out_ggaa([], Y, [], [])
split_in_ggaa(.(X, Xs), Y, .(X, Ls), Bs) → U5_ggaa(X, Xs, Y, Ls, Bs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_ggaa(X, Xs, Y, Ls, Bs, le_out_gg(X, Y)) → U6_ggaa(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
split_in_ggaa(.(X, Xs), Y, Ls, .(X, Bs)) → U7_ggaa(X, Xs, Y, Ls, Bs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_ggaa(X, Xs, Y, Ls, Bs, gt_out_gg(X, Y)) → U8_ggaa(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
U8_ggaa(X, Xs, Y, Ls, Bs, split_out_ggaa(Xs, Y, Ls, Bs)) → split_out_ggaa(.(X, Xs), Y, Ls, .(X, Bs))
U6_ggaa(X, Xs, Y, Ls, Bs, split_out_ggaa(Xs, Y, Ls, Bs)) → split_out_ggaa(.(X, Xs), Y, .(X, Ls), Bs)
U1_ga(H, L, S, split_out_ggaa(L, H, A, B)) → U2_ga(H, L, S, B, qsort_in_ga(A, A1))
U2_ga(H, L, S, B, qsort_out_ga(A, A1)) → U3_ga(H, L, S, A1, qsort_in_ga(B, B1))
U3_ga(H, L, S, A1, qsort_out_ga(B, B1)) → U4_ga(H, L, S, append_in_gga(A1, .(H, B1), S))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U9_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U9_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U4_ga(H, L, S, append_out_gga(A1, .(H, B1), S)) → qsort_out_ga(.(H, L), S)

The argument filtering Pi contains the following mapping:
qsort_in_ga(x1, x2)  =  qsort_in_ga(x1)
[]  =  []
qsort_out_ga(x1, x2)  =  qsort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x1, x4)
split_in_ggaa(x1, x2, x3, x4)  =  split_in_ggaa(x1, x2)
split_out_ggaa(x1, x2, x3, x4)  =  split_out_ggaa(x3, x4)
U5_ggaa(x1, x2, x3, x4, x5, x6)  =  U5_ggaa(x1, x2, x3, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U6_ggaa(x1, x2, x3, x4, x5, x6)  =  U6_ggaa(x1, x6)
U7_ggaa(x1, x2, x3, x4, x5, x6)  =  U7_ggaa(x1, x2, x3, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U8_ggaa(x1, x2, x3, x4, x5, x6)  =  U8_ggaa(x1, x6)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x1, x4, x5)
U3_ga(x1, x2, x3, x4, x5)  =  U3_ga(x1, x4, x5)
U4_ga(x1, x2, x3, x4)  =  U4_ga(x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
U9_gga(x1, x2, x3, x4, x5)  =  U9_gga(x1, x5)
U5_GGAA(x1, x2, x3, x4, x5, x6)  =  U5_GGAA(x1, x2, x3, x6)
U7_GGAA(x1, x2, x3, x4, x5, x6)  =  U7_GGAA(x1, x2, x3, x6)
SPLIT_IN_GGAA(x1, x2, x3, x4)  =  SPLIT_IN_GGAA(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

U7_GGAA(X, Xs, Y, Ls, Bs, gt_out_gg(X, Y)) → SPLIT_IN_GGAA(Xs, Y, Ls, Bs)
SPLIT_IN_GGAA(.(X, Xs), Y, .(X, Ls), Bs) → U5_GGAA(X, Xs, Y, Ls, Bs, le_in_gg(X, Y))
SPLIT_IN_GGAA(.(X, Xs), Y, Ls, .(X, Bs)) → U7_GGAA(X, Xs, Y, Ls, Bs, gt_in_gg(X, Y))
U5_GGAA(X, Xs, Y, Ls, Bs, le_out_gg(X, Y)) → SPLIT_IN_GGAA(Xs, Y, Ls, Bs)

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U5_GGAA(x1, x2, x3, x4, x5, x6)  =  U5_GGAA(x1, x2, x3, x6)
U7_GGAA(x1, x2, x3, x4, x5, x6)  =  U7_GGAA(x1, x2, x3, x6)
SPLIT_IN_GGAA(x1, x2, x3, x4)  =  SPLIT_IN_GGAA(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

U5_GGAA(X, Xs, Y, le_out_gg) → SPLIT_IN_GGAA(Xs, Y)
U7_GGAA(X, Xs, Y, gt_out_gg) → SPLIT_IN_GGAA(Xs, Y)
SPLIT_IN_GGAA(.(X, Xs), Y) → U7_GGAA(X, Xs, Y, gt_in_gg(X, Y))
SPLIT_IN_GGAA(.(X, Xs), Y) → U5_GGAA(X, Xs, Y, le_in_gg(X, Y))

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U11_gg(le_out_gg) → le_out_gg
U10_gg(gt_out_gg) → gt_out_gg

The set Q consists of the following terms:

le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U11_gg(x0)
U10_gg(x0)

We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

QSORT_IN_GA(.(H, L), S) → U1_GA(H, L, S, split_in_ggaa(L, H, A, B))
U1_GA(H, L, S, split_out_ggaa(L, H, A, B)) → U2_GA(H, L, S, B, qsort_in_ga(A, A1))
U1_GA(H, L, S, split_out_ggaa(L, H, A, B)) → QSORT_IN_GA(A, A1)
U2_GA(H, L, S, B, qsort_out_ga(A, A1)) → QSORT_IN_GA(B, B1)

The TRS R consists of the following rules:

qsort_in_ga([], []) → qsort_out_ga([], [])
qsort_in_ga(.(H, L), S) → U1_ga(H, L, S, split_in_ggaa(L, H, A, B))
split_in_ggaa([], Y, [], []) → split_out_ggaa([], Y, [], [])
split_in_ggaa(.(X, Xs), Y, .(X, Ls), Bs) → U5_ggaa(X, Xs, Y, Ls, Bs, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_ggaa(X, Xs, Y, Ls, Bs, le_out_gg(X, Y)) → U6_ggaa(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
split_in_ggaa(.(X, Xs), Y, Ls, .(X, Bs)) → U7_ggaa(X, Xs, Y, Ls, Bs, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_ggaa(X, Xs, Y, Ls, Bs, gt_out_gg(X, Y)) → U8_ggaa(X, Xs, Y, Ls, Bs, split_in_ggaa(Xs, Y, Ls, Bs))
U8_ggaa(X, Xs, Y, Ls, Bs, split_out_ggaa(Xs, Y, Ls, Bs)) → split_out_ggaa(.(X, Xs), Y, Ls, .(X, Bs))
U6_ggaa(X, Xs, Y, Ls, Bs, split_out_ggaa(Xs, Y, Ls, Bs)) → split_out_ggaa(.(X, Xs), Y, .(X, Ls), Bs)
U1_ga(H, L, S, split_out_ggaa(L, H, A, B)) → U2_ga(H, L, S, B, qsort_in_ga(A, A1))
U2_ga(H, L, S, B, qsort_out_ga(A, A1)) → U3_ga(H, L, S, A1, qsort_in_ga(B, B1))
U3_ga(H, L, S, A1, qsort_out_ga(B, B1)) → U4_ga(H, L, S, append_in_gga(A1, .(H, B1), S))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L1), L2, .(H, L3)) → U9_gga(H, L1, L2, L3, append_in_gga(L1, L2, L3))
U9_gga(H, L1, L2, L3, append_out_gga(L1, L2, L3)) → append_out_gga(.(H, L1), L2, .(H, L3))
U4_ga(H, L, S, append_out_gga(A1, .(H, B1), S)) → qsort_out_ga(.(H, L), S)

The argument filtering Pi contains the following mapping:
qsort_in_ga(x1, x2)  =  qsort_in_ga(x1)
[]  =  []
qsort_out_ga(x1, x2)  =  qsort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x1, x4)
split_in_ggaa(x1, x2, x3, x4)  =  split_in_ggaa(x1, x2)
split_out_ggaa(x1, x2, x3, x4)  =  split_out_ggaa(x3, x4)
U5_ggaa(x1, x2, x3, x4, x5, x6)  =  U5_ggaa(x1, x2, x3, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U6_ggaa(x1, x2, x3, x4, x5, x6)  =  U6_ggaa(x1, x6)
U7_ggaa(x1, x2, x3, x4, x5, x6)  =  U7_ggaa(x1, x2, x3, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U8_ggaa(x1, x2, x3, x4, x5, x6)  =  U8_ggaa(x1, x6)
U2_ga(x1, x2, x3, x4, x5)  =  U2_ga(x1, x4, x5)
U3_ga(x1, x2, x3, x4, x5)  =  U3_ga(x1, x4, x5)
U4_ga(x1, x2, x3, x4)  =  U4_ga(x4)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
U9_gga(x1, x2, x3, x4, x5)  =  U9_gga(x1, x5)
QSORT_IN_GA(x1, x2)  =  QSORT_IN_GA(x1)
U1_GA(x1, x2, x3, x4)  =  U1_GA(x1, x4)
U2_GA(x1, x2, x3, x4, x5)  =  U2_GA(x1, x4, x5)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
QDP
                    ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

U2_GA(H, B, qsort_out_ga(A1)) → QSORT_IN_GA(B)
U1_GA(H, split_out_ggaa(A, B)) → U2_GA(H, B, qsort_in_ga(A))
QSORT_IN_GA(.(H, L)) → U1_GA(H, split_in_ggaa(L, H))
U1_GA(H, split_out_ggaa(A, B)) → QSORT_IN_GA(A)

The TRS R consists of the following rules:

qsort_in_ga([]) → qsort_out_ga([])
qsort_in_ga(.(H, L)) → U1_ga(H, split_in_ggaa(L, H))
split_in_ggaa([], Y) → split_out_ggaa([], [])
split_in_ggaa(.(X, Xs), Y) → U5_ggaa(X, Xs, Y, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U11_gg(le_out_gg) → le_out_gg
U5_ggaa(X, Xs, Y, le_out_gg) → U6_ggaa(X, split_in_ggaa(Xs, Y))
split_in_ggaa(.(X, Xs), Y) → U7_ggaa(X, Xs, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U10_gg(gt_out_gg) → gt_out_gg
U7_ggaa(X, Xs, Y, gt_out_gg) → U8_ggaa(X, split_in_ggaa(Xs, Y))
U8_ggaa(X, split_out_ggaa(Ls, Bs)) → split_out_ggaa(Ls, .(X, Bs))
U6_ggaa(X, split_out_ggaa(Ls, Bs)) → split_out_ggaa(.(X, Ls), Bs)
U1_ga(H, split_out_ggaa(A, B)) → U2_ga(H, B, qsort_in_ga(A))
U2_ga(H, B, qsort_out_ga(A1)) → U3_ga(H, A1, qsort_in_ga(B))
U3_ga(H, A1, qsort_out_ga(B1)) → U4_ga(append_in_gga(A1, .(H, B1)))
append_in_gga([], L) → append_out_gga(L)
append_in_gga(.(H, L1), L2) → U9_gga(H, append_in_gga(L1, L2))
U9_gga(H, append_out_gga(L3)) → append_out_gga(.(H, L3))
U4_ga(append_out_gga(S)) → qsort_out_ga(S)

The set Q consists of the following terms:

qsort_in_ga(x0)
split_in_ggaa(x0, x1)
le_in_gg(x0, x1)
U11_gg(x0)
U5_ggaa(x0, x1, x2, x3)
gt_in_gg(x0, x1)
U10_gg(x0)
U7_ggaa(x0, x1, x2, x3)
U8_ggaa(x0, x1)
U6_ggaa(x0, x1)
U1_ga(x0, x1)
U2_ga(x0, x1, x2)
U3_ga(x0, x1, x2)
append_in_gga(x0, x1)
U9_gga(x0, x1)
U4_ga(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


QSORT_IN_GA(.(H, L)) → U1_GA(H, split_in_ggaa(L, H))
The remaining pairs can at least be oriented weakly.

U2_GA(H, B, qsort_out_ga(A1)) → QSORT_IN_GA(B)
U1_GA(H, split_out_ggaa(A, B)) → U2_GA(H, B, qsort_in_ga(A))
U1_GA(H, split_out_ggaa(A, B)) → QSORT_IN_GA(A)
Used ordering: Polynomial interpretation [25]:

POL(.(x1, x2)) = 1 + x2   
POL(0) = 1   
POL(QSORT_IN_GA(x1)) = 1 + x1   
POL(U10_gg(x1)) = 1   
POL(U11_gg(x1)) = 0   
POL(U1_GA(x1, x2)) = 1 + x2   
POL(U1_ga(x1, x2)) = 0   
POL(U2_GA(x1, x2, x3)) = 1 + x2   
POL(U2_ga(x1, x2, x3)) = 0   
POL(U3_ga(x1, x2, x3)) = 0   
POL(U4_ga(x1)) = 0   
POL(U5_ggaa(x1, x2, x3, x4)) = 1 + x2   
POL(U6_ggaa(x1, x2)) = 1 + x2   
POL(U7_ggaa(x1, x2, x3, x4)) = 1 + x2   
POL(U8_ggaa(x1, x2)) = 1 + x2   
POL(U9_gga(x1, x2)) = 0   
POL([]) = 0   
POL(append_in_gga(x1, x2)) = 1 + x2   
POL(append_out_gga(x1)) = 0   
POL(gt_in_gg(x1, x2)) = 1 + x2   
POL(gt_out_gg) = 1   
POL(le_in_gg(x1, x2)) = 0   
POL(le_out_gg) = 0   
POL(qsort_in_ga(x1)) = 0   
POL(qsort_out_ga(x1)) = 0   
POL(s(x1)) = 1 + x1   
POL(split_in_ggaa(x1, x2)) = x1   
POL(split_out_ggaa(x1, x2)) = x1 + x2   

The following usable rules [17] were oriented:

U7_ggaa(X, Xs, Y, gt_out_gg) → U8_ggaa(X, split_in_ggaa(Xs, Y))
U5_ggaa(X, Xs, Y, le_out_gg) → U6_ggaa(X, split_in_ggaa(Xs, Y))
split_in_ggaa(.(X, Xs), Y) → U7_ggaa(X, Xs, Y, gt_in_gg(X, Y))
U8_ggaa(X, split_out_ggaa(Ls, Bs)) → split_out_ggaa(Ls, .(X, Bs))
U6_ggaa(X, split_out_ggaa(Ls, Bs)) → split_out_ggaa(.(X, Ls), Bs)
split_in_ggaa(.(X, Xs), Y) → U5_ggaa(X, Xs, Y, le_in_gg(X, Y))
split_in_ggaa([], Y) → split_out_ggaa([], [])



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
QDP
                        ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

U1_GA(H, split_out_ggaa(A, B)) → U2_GA(H, B, qsort_in_ga(A))
U2_GA(H, B, qsort_out_ga(A1)) → QSORT_IN_GA(B)
U1_GA(H, split_out_ggaa(A, B)) → QSORT_IN_GA(A)

The TRS R consists of the following rules:

qsort_in_ga([]) → qsort_out_ga([])
qsort_in_ga(.(H, L)) → U1_ga(H, split_in_ggaa(L, H))
split_in_ggaa([], Y) → split_out_ggaa([], [])
split_in_ggaa(.(X, Xs), Y) → U5_ggaa(X, Xs, Y, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U11_gg(le_out_gg) → le_out_gg
U5_ggaa(X, Xs, Y, le_out_gg) → U6_ggaa(X, split_in_ggaa(Xs, Y))
split_in_ggaa(.(X, Xs), Y) → U7_ggaa(X, Xs, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U10_gg(gt_out_gg) → gt_out_gg
U7_ggaa(X, Xs, Y, gt_out_gg) → U8_ggaa(X, split_in_ggaa(Xs, Y))
U8_ggaa(X, split_out_ggaa(Ls, Bs)) → split_out_ggaa(Ls, .(X, Bs))
U6_ggaa(X, split_out_ggaa(Ls, Bs)) → split_out_ggaa(.(X, Ls), Bs)
U1_ga(H, split_out_ggaa(A, B)) → U2_ga(H, B, qsort_in_ga(A))
U2_ga(H, B, qsort_out_ga(A1)) → U3_ga(H, A1, qsort_in_ga(B))
U3_ga(H, A1, qsort_out_ga(B1)) → U4_ga(append_in_gga(A1, .(H, B1)))
append_in_gga([], L) → append_out_gga(L)
append_in_gga(.(H, L1), L2) → U9_gga(H, append_in_gga(L1, L2))
U9_gga(H, append_out_gga(L3)) → append_out_gga(.(H, L3))
U4_ga(append_out_gga(S)) → qsort_out_ga(S)

The set Q consists of the following terms:

qsort_in_ga(x0)
split_in_ggaa(x0, x1)
le_in_gg(x0, x1)
U11_gg(x0)
U5_ggaa(x0, x1, x2, x3)
gt_in_gg(x0, x1)
U10_gg(x0)
U7_ggaa(x0, x1, x2, x3)
U8_ggaa(x0, x1)
U6_ggaa(x0, x1)
U1_ga(x0, x1)
U2_ga(x0, x1, x2)
U3_ga(x0, x1, x2)
append_in_gga(x0, x1)
U9_gga(x0, x1)
U4_ga(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 3 less nodes.